<ul class="layui-nav layui-nav-tree" id="sideNav" lay-filter="submenu">
    @foreach($submenudata as $item)
        @if(isset($item['sub']) && empty($item['sub']))
            @if(Entrust::can($item['slug']))
                <li class="layui-nav-item">
                    <a href="javascript:;" data-url="{{$item['url']}}" data-title="{{$item['name']}}">
                        <i class="yjs-icon" data-icon="{{$item['iconfont']}}">{{$item['iconfont']}}</i>
                        <cite>{{$item['name']}}</cite>
                    </a>
                </li>
            @endif
        @else
            {{--<li class="layui-nav-item layui-nav-itemed">--}}

            <li class="layui-nav-item">
                @if(Entrust::can($item['slug']))
                    <a href="javascript:;">
                        <i class="yjs-icon">{{$item['iconfont']}}</i>
                        <cite>{{$item['name']}}</cite>
                    </a>
                @endif
                <dl class="layui-nav-child">
                    <dd data-pid="0-0">
                        <a id="homepage" href="javascript:;" data-url="/welcome" data-title="首页">
                            <i class="yjs-icon" data-icon=""></i>
                            <cite>首页</cite>
                        </a>
                    </dd>
                    @foreach($item['sub'] as $subitem)
                        @if(Entrust::can($subitem['slug']))
                            <dd data-pid="{{$subitem['code']}}">
                                <a href="javascript:;" data-url="{{$subitem['url']}}" data-title="{{$subitem['name']}}">
                                    <i class="yjs-icon" data-icon="{{$subitem['iconfont']}}">{{$subitem['iconfont']}}</i>
                                    <cite>{{$subitem['name']}}</cite>
                                    {{--<span class="layui-badge">9</span>--}}
                                </a>
                            </dd>
                        @endif
                    @endforeach
                </dl>
            </li>
        @endif
    @endforeach
</ul>